/**
 * Create Date: 2006-12-27
 */
package com.jmcgg.freesky.common.util;

/**
 * <b>Acosy</b> = <b>A</b> <b>C</b>ycle <b>O</b>f <b>S</b>ixty <b>Y</b>ears
 *
 */
/**
 * Title: FreeSky Common Java Library <br>
 * Description: FreeSky Common Java Library <br>
 * Copyright: Copyright (c) 2005~2009 www.afss.cn <br>
 * Company: Amei's FreeSky Studio <br>
 * 
 * @author <b>Jacky Chou</b> (AFSS [Amei's FreeSky Studio])
 * @version 1.2.1, 2008-08-05, Clean and optimize the source code. <br>
 *          1.2.0, 2008-02-23, Upgrade freesky.jar to 1.2.0 with Struts 2 <br>
 *          1.0.0, 2006-05-30, Initial Version
 */
@Deprecated
public class AcosyBean extends FreeskyBean {
	// 01234 56789 ABCDE FGHIJ KLMNO PQRST UVWXY Zabcd efghi jklmn opqrs tuvwx
	private final static String acosy = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx";
	public final static String tag = "x"; // b=2; o=8; A=10; Z=36; x=60;

	// private final static String[] acosyArray = { "0", "1", "2", "3", "4",
	// "5",
	// "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
	// "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
	// "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i",
	// "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
	// "w", "x" };
	//
	// private final static char[] acosyChar = { '0', '1', '2', '3', '4', '5',
	// '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
	// 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
	// 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
	// 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
	// 'w', 'x' };

	/**
	 * Get the corresponding char (bit) according to the input num
	 * 
	 * @param num
	 * @return
	 */
	public static String getAcosy(int num) {
		int idx = 0;
		if (num >= 0)
			idx = num % 60;
		else
			idx = (-num) % 60;
		return acosy.substring(idx, idx + 1);
	}

	public static int getDecimalSingle(String _acosy) {
		if (_acosy == null || _acosy.length() == 0 || _acosy.length() > 1)
			return -1;
		return acosy.indexOf(_acosy);
	}

	public static int toDecimal(String sixond) {
		// FIXME: not implemented yet
		return -1;
	}

}
